package org.budo.ip.location.service.api.util;

import org.budo.ip.location.service.api.BudoIpLocation;
import org.budo.ip.location.service.api.BudoIpLocationService;

/**
 * @author lmw
 */
public class IpLocationUtil {
    public static BudoIpLocation[] seekIpLocationArray(BudoIpLocationService ipLocationService, String[] ipArray) {
        if (null == ipArray) {
            return null;
        }

        BudoIpLocation[] locations = new BudoIpLocation[ipArray.length];
        for (int i = 0; i < ipArray.length; i++) {
            String ip = ipArray[i];
            locations[i] = ipLocationService.seekIpLocation(ip);
        }

        return locations;
    }
}